/**
 * @file
 * @author  Tsin Smith <tsin.creator@gmail.com>
 *
 * @section DESCRIPTION
 *
 */

#ifndef __TSIN_LIBRARY_BULLETGENERATOR_HPP__
#define __TSIN_LIBRARY_BULLETGENERATOR_HPP__

#include <tsin/library/common.hpp>
#include <tsin/library/DynamicObject.hpp>

namespace tsin {

        class BulletPlacer;
        class BulletDirector;
        class BulletRouter;
        class BulletDresser;
        class BulletEventFiller;
        class GameRuntime;
        class GameViewport;

        class LIBRARY_DLLEXPORT BulletGenerator : public DynamicObject {
        public:
                BulletGenerator();
                ~BulletGenerator();

                virtual DynamicObject *copy();

                void init(int num, BulletDresser *dresser, BulletPlacer *placer,
                          BulletDirector *director, BulletRouter *router, BulletEventFiller *filler);
                virtual void reinit();
                virtual DynamicEvent postTick(void *data = 0, void *priv_data = 0);
                virtual char getDescriptor();

                void generate(GameRuntime *runtime, GameViewport *viewport, void *data);
                void generate(GameRuntime *runtime, GameViewport *viewport, void *data, int n);

        private:
                int defaultNum;

                BulletPlacer *placer;
                BulletDirector *director;
                BulletRouter *router;
                BulletDresser *dresser;
                BulletEventFiller *filler;
        };

}

#endif /* __TSIN_LIBRARY_BULLETGENERATOR_HPP__ */
